#include "BPEController.h"

BPEController::BPEController(){
	pWorld = shared_ptr<BPEPhysicsWorld>();
	pWorld->setUniversalSpeed(BPEVector3d(0,-0.01,0));


};


BPEController::BPEController(const BPEPoint3d &worldSize){
	pWorld = shared_ptr<BPEPhysicsWorld>(new BPEPhysicsWorld(worldSize));
	pWorld->setUniversalSpeed(BPEVector3d(0,-0.1,0));
	//pWorld->addUniversalForce(BPEVector3d(0.002,0.001,0));

	

};



void BPEController::addIrrlichtMeshSceneNode(ISceneNode *x,const double &mass,const bool& physicsOn){

	bpeMeshSceneNodeObjects.push_back(x);
	
	x->updateAbsolutePosition();


	shared_ptr<BPEPhysicsObject> pObject = shared_ptr<BPEIrrlichtPhysicsObject>(new BPEIrrlichtPhysicsObject(x,mass,physicsOn));
	pWorld->addPhysicsObject(pObject);


};



void BPEController::gameRoutine(){


	pWorld->physicsRoutine();

};

